package com.morgankelly.service;

import java.util.List;

import com.morgankelly.dao.AccountDAO;
import com.morgankelly.po.Account;

public class AuthenticationServiceImpl implements AuthenticationService {
	
	public AccountDAO accountDAO = AccountDAO.get();
	

	public Account getAccountByName(String name) {
		return accountDAO.getAccountByName(name);
	}

	public List<Account> getAccountList() {
		return accountDAO.findAll();
	}
	
	public void addAccount(Account account) {
		accountDAO.add(account);
	}

	@Override
	public Account getAccountByID(Long id) {
		return accountDAO.findByID(id);
	}

	@Override
	public void deleteAccountByID(Long id) {
		accountDAO.deleteByID(id);
	}

	@Override
	public void updateAccount(Long id, String name, String password,
			String displayName, String email, String role, String picPath) {
		accountDAO.update(id, name, password, displayName, email, role, picPath);
		
	}
}
